#include<stdio.h>

int main()
{
    double salary = 30.0;
    int year, time;
    scanf("%d %d", &year, &time);
    if(year >= 5)
    {
        salary = 50;
    }
    if(time <= 40)
    {
        salary = time * salary;
    }
    else
    {
        salary = 1.5 * (time - 40) * salary + 40 * salary;
    }
    printf("%.2f",salary);
    
    return 0;
}